/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sofia.Persistencia.Entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "secretaria", catalog = "sofia", schema = "")
@NamedQueries({
        @NamedQuery(name = "ESecretaria.findAll", query = "SELECT e FROM ESecretaria e"),
        @NamedQuery(name = "ESecretaria.findByIdSecretaria", query = "SELECT e FROM ESecretaria e WHERE e.idSecretaria = :idSecretaria"),
        @NamedQuery(name = "ESecretaria.findByNombre", query = "SELECT e FROM ESecretaria e WHERE e.nombre = :nombre"),
        @NamedQuery(name = "ESecretaria.findByCedula", query = "SELECT e FROM ESecretaria e WHERE e.cedula = :cedula"),
        @NamedQuery(name = "ESecretaria.findByTelefono", query = "SELECT e FROM ESecretaria e WHERE e.telefono = :telefono"),
        @NamedQuery(name = "ESecretaria.findByEmail", query = "SELECT e FROM ESecretaria e WHERE e.email = :email")})
public class ESecretaria implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @Basic(optional = false)
        @Column(name = "id_secretaria", nullable = false, length = 50)
        private String idSecretaria;
        @Basic(optional = false)
        @Column(name = "nombre", nullable = false, length = 120)
        private String nombre;
        @Basic(optional = false)
        @Column(name = "cedula", nullable = false, length = 20)
        private String cedula;
        @Column(name = "telefono", length = 40)
        private String telefono;
        @Column(name = "email", length = 50)
        private String email;
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "eSecretaria")
        private List<ETerapia> eTerapiaList;

        public ESecretaria() {
        }

        public ESecretaria(String idSecretaria) {
                this.idSecretaria = idSecretaria;
        }

        public ESecretaria(String idSecretaria, String nombre, String cedula) {
                this.idSecretaria = idSecretaria;
                this.nombre = nombre;
                this.cedula = cedula;
        }

        public String getIdSecretaria() {
                return idSecretaria;
        }

        public void setIdSecretaria(String idSecretaria) {
                this.idSecretaria = idSecretaria;
        }

        public String getNombre() {
                return nombre;
        }

        public void setNombre(String nombre) {
                this.nombre = nombre;
        }

        public String getCedula() {
                return cedula;
        }

        public void setCedula(String cedula) {
                this.cedula = cedula;
        }

        public String getTelefono() {
                return telefono;
        }

        public void setTelefono(String telefono) {
                this.telefono = telefono;
        }

        public String getEmail() {
                return email;
        }

        public void setEmail(String email) {
                this.email = email;
        }

        public List<ETerapia> getETerapiaList() {
                return eTerapiaList;
        }

        public void setETerapiaList(List<ETerapia> eTerapiaList) {
                this.eTerapiaList = eTerapiaList;
        }

        @Override
        public int hashCode() {
                int hash = 0;
                hash += (idSecretaria != null ? idSecretaria.hashCode() : 0);
                return hash;
        }

        @Override
        public boolean equals(Object object) {
                // TODO: Warning - this method won't work in the case the id fields are not set
                if (!(object instanceof ESecretaria)) {
                        return false;
                }
                ESecretaria other = (ESecretaria) object;
                if ((this.idSecretaria == null && other.idSecretaria != null) || (this.idSecretaria != null && !this.idSecretaria.equals(other.idSecretaria))) {
                        return false;
                }
                return true;
        }

        @Override
        public String toString() {
                return "sofia.Persistencia.Entidades.ESecretaria[idSecretaria=" + idSecretaria + "]";
        }

}
